// 用户态跳板函数

#define SYS_fork    1
#define SYS_exit    2
#define SYS_wait    3
#define SYS_pipe    4
#define SYS_read    5
#define SYS_kill    6
#define SYS_exec    7
#define SYS_fstat   8
#define SYS_chdir   9
#define SYS_dup    10
#define SYS_getpid 11
#define SYS_sbrk   12
#define SYS_sleep  13
#define SYS_uptime 14
#define SYS_open   15
#define SYS_write  16
#define SYS_mknod  17
#define SYS_unlink 18
#define SYS_link   19
#define SYS_mkdir  20
#define SYS_close  21

.global fork
fork:
    li.d $a7, SYS_fork
    syscall 0
    jirl $zero, $ra, 0
 
.global exit
exit:
    li.d $a7, SYS_exit
    syscall 0
    jirl $zero, $ra, 0
 
.global wait
wait:
    li.d $a7, SYS_wait
    syscall 0
    jirl $zero, $ra, 0
 
.global pipe
pipe:
    li.d $a7, SYS_pipe
    syscall 0
    jirl $zero, $ra, 0
 
.global read
read:
    li.d $a7, SYS_read
    syscall 0
    jirl $zero, $ra, 0
 
.global write
write:
    li.d $a7, SYS_write
    syscall 0
    jirl $zero, $ra, 0
 
.global close
close:
    li.d $a7, SYS_close
    syscall 0
    jirl $zero, $ra, 0
 
.global kill
kill:
    li.d $a7, SYS_kill
    syscall 0
    jirl $zero, $ra, 0
 
.global exec
exec:
    li.d $a7, SYS_exec
    syscall 0
    jirl $zero, $ra, 0
 
.global open
open:
    li.d $a7, SYS_open
    syscall 0
    jirl $zero, $ra, 0
 
.global mknod
mknod:
    li.d $a7, SYS_mknod
    syscall 0
    jirl $zero, $ra, 0
 
.global unlink
unlink:
    li.d $a7, SYS_unlink
    syscall 0
    jirl $zero, $ra, 0
 
.global fstat
fstat:
    li.d $a7, SYS_fstat
    syscall 0
    jirl $zero, $ra, 0
 
.global link
link:
    li.d $a7, SYS_link
    syscall 0
    jirl $zero, $ra, 0
 
.global mkdir
mkdir:
    li.d $a7, SYS_mkdir
    syscall 0
    jirl $zero, $ra, 0
 
.global chdir
chdir:
    li.d $a7, SYS_chdir
    syscall 0
    jirl $zero, $ra, 0
 
.global dup
dup:
    li.d $a7, SYS_dup
    syscall 0
    jirl $zero, $ra, 0
 
.global getpid
getpid:
    li.d $a7, SYS_getpid
    syscall 0
    jirl $zero, $ra, 0
 
.global sbrk
sbrk:
    li.d $a7, SYS_sbrk
    syscall 0
    jirl $zero, $ra, 0
 
.global sleep
sleep:
    li.d $a7, SYS_sleep
    syscall 0
    jirl $zero, $ra, 0
 
.global uptime
uptime:
    li.d $a7, SYS_uptime
    syscall 0
    jirl $zero, $ra, 0
 
